.SUFFIXES : .o .c .f .f90
# compiler
FC = gfortran
CC = cc

# optimization flags
OFLAG = -O3

# Fortran and C flags
FFLAGS = $(DFLAGS) $(OFLAG) $(DEBUG)
CFLAGS = $(DFLAGS) $(OFLAG) $(DEBUG)
 
# Fortran 90/95 format
#FREE = -FR
FREE = -ffree-form #-ffree-line-length-none
 
# Debug flags
#DEBUG  = -g #-traceback #-D_DEBUG
#
# MPI or OpenMP
#MPI = -DOMP -fopenmp
#====================================================================
BASE = molecular
MAIN = ${BASE}
# source and rules
#====================================================================
SOURCE = prec.o basic.o  identify.o dispinfo.o writeinfo.o main.o \
         modify.o lc5cb.o hexene.o octene.o decene.o water.o      \
         methane.o butene.o ethylene.o dodecene.o betahexene.o    \
         ghexene.o hexene_dimer.o oleic_acid.o dye.o readmol.o    \
         nafion.o hydrocarbon.o
#====================================================================
all:  ${MAIN}

${MAIN}:  $(SOURCE)
	$(FC) $(SOURCE) $(OFLAG) $(MPI) $(LIB) -o $@

clean: 
	rm -f *.o *~ *.mod ${MAIN}

tar:
	rm -f ${BASE}.tar; tar -czvf ${BASE}.tar.gz *.f90 Makefile MAKE/Make.* README


.f.o:
	$(FC) $(FFLAGS) $(FREE) $(MPI) ${INC} -c $<
.f90.o:
	$(FC) $(FFLAGS) $(FREE) $(MPI) ${INC} -c $<
.c.o:
	$(CC) $(CFLAGS) $(MPI) -c $<
